﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using DAO;
using DTO;

namespace BUS
{
    public class SANPHAMBUS
    {
        public DataTable LoadDsSanPham()
        {
            SANPHAMDAO spDAO = new SANPHAMDAO();
            DataTable dt = new DataTable();
            dt = spDAO.LoadSanPham();
            return dt;
        }

        public void ThemSP(SANPHAMDTO spDTO)
        {
            SANPHAMDAO spDao = new SANPHAMDAO();
            spDao.ThemSanPham(spDTO);
        }

        public void XoaSP(int ma)
        {
            SANPHAMDAO spDao = new SANPHAMDAO();
            spDao.XoaSanPham(ma);
        }

        public void SuaSP(SANPHAMDTO spDto)
        {
            SANPHAMDAO spDao = new SANPHAMDAO();
            spDao.SuaSanPham(spDto);
        }

        public DataTable LoadDsTimKiem(string tukhoa)
        {
            SANPHAMDAO spDao = new SANPHAMDAO();
            DataTable dt = new DataTable();
            dt = spDao.LoadTimKiem(tukhoa);
            return dt;
        }

        public DataTable LoadDsTim(string tukhoa)
        {
            SANPHAMDAO spDao = new SANPHAMDAO();
            DataTable dt = new DataTable();
            dt = spDao.LoadTim(tukhoa);
            return dt;
        }

        public void SuaSL(int ma, int ghkho, int ghquay, int slhtkho, int slhtquay)
        {
            SANPHAMDAO spDao = new SANPHAMDAO();
            spDao.SuaSoLuong(ma,ghkho,ghquay,slhtkho,slhtquay);
        }
    }
}
